package RMI;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.ArrayList;
import java.util.Set;

import search.SearchTuple;

/**
 * interface of the RMI
 * @author ran & barak
 *
 */
public interface RemoteInt  extends Remote{
	/**
	 * send command to the service to create new folder
	 * @param boxName - folder name
	 * @return success or failure
	 * @throws RemoteException
	 */
	boolean createNewBox(String boxName) throws RemoteException;
	/**
	 * send command to the service to stop communicate with server
	 * @throws RemoteException
	 */
	void stopSync()throws RemoteException;
	/**
	 * send command to the service to start communicate with server
	 * @throws RemoteException
	 */
	void startSync()throws RemoteException;
	/**
	 * send command to the service to search file with certain tag
	 * in certain tag\s type\s
	 * @param tag - tag texy
	 * @param tagTypeList - list of tag type to search
	 * @return array with search result
	 * @throws RemoteException
	 */
	ArrayList<SearchTuple> search(String tag,ArrayList<String> tagTypeList) throws RemoteException;
	/**
	 * send command to the service to add new tagging algorithm
	 * @param path location of plug in
	 * @param className - the name of plug in class 
	 * @return tag type name and list of the optional tags
	 * @throws RemoteException
	 */
	ArrayList<String> addPlugin(String path, String className) throws RemoteException;
	/**
	 * @return from service the user name
	 * @throws RemoteException
	 */
	String getUserName() throws RemoteException;
	/**
	 * @return from service the password
	 * @throws RemoteException
	 */
	String getPass() throws RemoteException;
	/**
	 * @return from service the user email
	 * @throws RemoteException
	 */
	String getEmail() throws RemoteException;
	/**
	 * @return from service all user folders
	 * @throws RemoteException
	 */
	Set<String> getBoxesList() throws RemoteException;
	/**
	 * send command to the service to share new folder with other users
	 * @param emails list with the emails of users we want to share
	 * @param str name of the folder the user want to share
	 * @throws RemoteException
	 */
	void shareBox(ArrayList<String> emails, String str) throws RemoteException;
	/**
	 * send command to the service to open file
	 * @param path the file location
	 * @throws RemoteException
	 */
	void openFile(String path)throws RemoteException;
	/**
	 * send command to the service to search files with certain tags
	 * @param tag the tags we want to search
	 * @return array with search result
	 * @throws RemoteException
	 */
	public ArrayList<SearchTuple> advencedSearch(ArrayList<String> tag)throws RemoteException;
	/**
	 * send command to the service to set the algorithms that use for tagging new files
	 * @param tagTypes the tag types we want to tag with
	 * @throws RemoteException
	 */
	void changeTagAlgoValid(ArrayList<String> tagTypes)throws RemoteException;
	/**
	 * @return all tag types and their tag option
	 * @throws RemoteException
	 */
	ArrayList<ArrayList<String>> getPlugins()throws RemoteException;
}
